<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
	<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
	
<!DOCTYPE html >
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script type="text/javascript">
	function checkForm() {
		var username = document.getElementById("username").value;
		if (username == null || username == "") {
			alert("用户名称不能为空！");
			return;
		}
		var password = document.getElementById("password").value;
		var repassword = document.getElementById("repassword").value;
		if (password == null || password == "") {
			alert("用户密码不能为空！");
			return;
		}
		if (password != repassword) {
			alert(password + "," + repassword);
			alert("两次输入的密码不一致！");
			return;
		}
	}

	function change() {
		var img = document.getElementById("img");
		img.src = "CodeServlet?time=" + new Date().getTime();
	}
</script>
<title>酷妈妈商城--用户注册</title>
</head>
<body>
	<h1>用户注册</h1>
	<h4 style="color: red;">${msg}</h4>
	<form action="RegistServlet" method="post"
		onsubmit="return checkForm();">
		<table>
			<tr>
				<td>用户名：</td>
				<td><input type="text" name="username" id="username" /></td>
			</tr>
			<tr>
				<td>密码：</td>
				<td><input type="password" name="password" id="password" /></td>
			</tr>
			<tr>
				<td>确认密码：</td>
				<td><input type="password" name="repassword" id="repassword" /></td>
			</tr>
			<tr>
				<td>昵称：</td>
				<td><input type="text" name="nickname" /></td>
			</tr>
			<tr>
				<td>邮箱：</td>
				<td><input type="text" name="email" /></td>
			</tr>
			 <tr>
				<td>验证码：</td>
				<td><input type="text" name="checkcode" />
				<img src="CodeServlet" id="img" onclick="change();"
					style="cursor: pointer;"></td>
			</tr> 
			<tr>
				<td><input type="submit" value="注册" /></td>
				<td><input type="button" value="返回" onclick="history.go(-1);" /></td>
			</tr>
		</table>

	</form>
</body>
</html>